<!-- 废弃 -->


<template>
<div>
<el-card class="box-card" >
	<div slot="header" class="clearfix">
		<span>人员在线情况</span>
	</div>
	<el-row>
	<el-form :inline="true" :model="form" >
		<!-- <el-form-item >
			<daterange v-bind:se.sync="s_e" type="daterange"></daterange>
	    </el-form-item> -->

		<el-form-item >
		    <el-cascader 
				style="width:400px;"
				filterable
				:options="treedata"
				:props="props1"
				filterable
				change-on-select
				v-model="selectedOptions">
				</el-cascader>
		</el-form-item>

		<el-form-item>
		    <el-button type="primary" @click="init">查询</el-button>
		</el-form-item>
		
	</el-form>
	</el-row>

	<el-row>
	<el-table
	    :data="list"
	    border
	    show-summary
	    style="width: 100%">
	    <el-table-column
	      prop="company_name"
	      label="网格名"
	      width="200">
	    </el-table-column>

	    <el-table-column
	      prop="num"
	      label="数量"
	      width="100"
	      >
	    </el-table-column>

	    <el-table-column
	      prop="name"
	      label="人员名"
	      >
	    </el-table-column>

	  </el-table>
	</el-row>
</el-card>



</div>
</template>

<script>
import daterange from '@/components/daterange'

export default {
	
	name : 'helpList',
	
	data () {
		return {
		  	list : [],

		  	form : {},

		  	pageNo : 1,
		  	pageSize : 10,

		  	current : {},

		  	dialogVisible : false,

		  	s_e : [this.$util.date2str(new Date()), this.$util.date2str(new Date())],

		  	treedata : [],

		  	props1 : {
				value : 'id',
				label : 'name',
			},

			selectedOptions : [1],
		}
	},

	props : {

	},

	components : {
		daterange,
	},

	computed : {
		
	},

	methods : {
		init () {
			this.$http({
				fun : 'onlinestatistics',
				grid_id : this.selectedOptions[this.selectedOptions.length - 1] + '',
				// start_time : this.s_e[0] + ' 00:00:00',
				// end_time : this.s_e[1] + ' 23:59:59',
				cb : res => {
					console.log(res);
					this.list = res;
				}
			});
		},
	},

	watch : {
	    
	},

	mounted () {
		this.init();

		this.$http({
			fun : 'grideList',
			cb : res => {
				console.log(res);

				const result = this.$util.transData(res, 'id', 'parent_id', 'children');
				console.log(result);
				this.treedata = result;
				this.treedata.unshift({
					name : '全部网格',
					id : 1,
				});

			}
		});

	},

}
</script>

<style scoped>

</style>
